#include <crbprofiler.hpp>

CRBPROFILERSTART("mso_fnc_dominationMenuEntries");

private ["_results","_return"];
_return = [];
_results = ["DOM_ACTION_MENU",[player]] call tyr_fnc_execHandler;
if (!isnil "_results" && {typename _results == typename []}) then {
	// The result is in the format:
	//  array	[
	//				array	[
	//							["Menu Title 1","function call"],
	//							["Menu Title 2","function call"]
	//						],
	//				array	[
	//							["Menu Title 3","function call"]
	//						]
	//			]
	{
		if (typename _x == typename []) then {
			_sub_list = _x;
			{ if (typeName _x == typename []) then { _return set [count _return, _x]; };		
			} foreach _sub_list;
		};
	} foreach _results;
};
//diag_log format["mso_fnc_dominationMenuEntries: %1",_results];
CRBPROFILERSTOP;
_return;